package com.deep.spring.stream.io1;

import org.junit.Assert;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;

public class ClassPathResourceTest {
    public static void main(String[] args) throws IOException {
        v1();
    }

    public static void v1() throws IOException {
        Resource resource = new ClassPathResource("conf/custom-beans.xml");
        System.out.println(resource.getURL());
        System.out.println(resource.getFilename());
        System.out.println(resource.getFile().getPath());
// ... ....

        System.out.println(resource.contentLength());

    }

    @Test
    public void testClassPathResource() throws IOException {
        Resource res = new ClassPathResource("conf/custom-beans.xml");
        InputStream input = res.getInputStream();
        Assert.assertNotNull(input);
    }
}
